package cn.etouch.huangli;

import java.sql.SQLException;
import java.util.ArrayList;

public class HuangliMain {
	static String DbUrl="AllMessage.db";
	/**
	 * @param args
	 */
	public static Thread Thread1=new Thread(){//启动线程访问网络获得数据
		public void run() {
//			final ArrayList<HuangliOfOneDay> s = GetMessageFromNet.getLines("");
//			HuangliOfOneDay hlood = s.get(0);
//			try {
//				DBManager.insertHuangli("20110206", hlood.toXmlString());
//			} catch (SQLException e) {
//				// TODO Auto-generated catch block
//				e.printStackTrace();
//			}
//			System.out.println("Thread1-stop");
		};
	};
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		for (String monthkey : StaticString.monthkeys){
			for (String daykey : StaticString.daykeys){
				final ArrayList<HuangliOfOneDay> s = GetMessageFromNet.getLines(monthkey, daykey);
				HuangliOfOneDay hlood = s.get(0);
				try {
					DBManager.insertHuangli(hlood.date, hlood.toXmlString());
				} catch (SQLException e) {
					// TODO Auto-generated catch block
					e.printStackTrace();
				}
			}
		}
		
	
	}
}
